package com.tr.rentcar.controller.userc;

import java.io.IOException;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tr.rentcar.model.dao.OrderDao;
import com.tr.rentcar.model.dao.OrderRecordDao;

@WebServlet("/orderdelete")
public class OrderDeleteController extends HttpServlet {
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		try {
			int oid=Integer.parseInt(req.getParameter("oid"));
			new OrderRecordDao().insertRecord("支付超出时间自动取消", "系统", oid);
			resp.getWriter().println(new OrderDao().updateStatus("已取消",null,oid));
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

}
